<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader Host: Updater.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader Host
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Host Tools for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_updater_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Updater.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2013-14, Freescale Semiconductor, Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * All rights reserved.</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * Redistribution and use in source and binary forms, with or without modification,</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * are permitted provided that the following conditions are met:</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * o Redistributions of source code must retain the above copyright notice, this list</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> *   of conditions and the following disclaimer.</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * o Redistributions in binary form must reproduce the above copyright notice, this</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *   list of conditions and the following disclaimer in the documentation and/or</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *   other materials provided with the distribution.</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * o Neither the name of Freescale Semiconductor, Inc. nor the names of its</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *   contributors may be used to endorse or promote products derived from this</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *   software without specific prior written permission.</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#if !defined(_Updater_h_)</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#define _Updater_h_</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;Bootloader.h&quot;</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;SourceFile.h&quot;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespaceblfwk.html">blfwk</a>;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceblfwk.html">blfwk</a></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;{</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="structblfwk_1_1updater__enum__t.html">   45</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;{</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    uint32_t value;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    std::string description;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a>()</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        : value(0)</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        , description(<span class="stringliteral">&quot;&quot;</span>)</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    {</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    }</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a>(uint32_t value, <span class="keyword">const</span> <span class="keywordtype">char</span> *description)</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;        : value(value)</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        , description(description)</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    {</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    }</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a>(<span class="keyword">const</span> <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> &amp;old_enum)</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    {</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        value = old_enum.value;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        description = old_enum.description.c_str();</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    }</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;};</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keyword">const</span> <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> kUpdaterState_NotReady(0, <span class="stringliteral">&quot;Not ready&quot;</span>);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="keyword">const</span> <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> kUpdaterState_Ready(1, <span class="stringliteral">&quot;Ready&quot;</span>);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="keyword">const</span> <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> kUpdaterState_Working(2, <span class="stringliteral">&quot;Working&quot;</span>);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="keyword">const</span> <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> kUpdaterState_Idle(3, <span class="stringliteral">&quot;Idle&quot;</span>);</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="keyword">const</span> <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> kUpdaterState_Complete(4, <span class="stringliteral">&quot;Complete&quot;</span>);</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="keyword">const</span> <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> kUpdaterTask_Erasing(0, <span class="stringliteral">&quot;Erasing&quot;</span>);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="keyword">const</span> <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> kUpdaterTask_Flashing(1, <span class="stringliteral">&quot;Writing&quot;</span>);</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="keyword">const</span> <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> kUpdaterTask_Reseting(2, <span class="stringliteral">&quot;Reseting&quot;</span>);</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="keyword">const</span> <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> kUpdaterTask_Executing(3, <span class="stringliteral">&quot;Jumping&quot;</span>);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="structblfwk_1_1updater__task__t.html">   82</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structblfwk_1_1updater__task__t.html">updater_task_t</a></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;{</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> task_desc;</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    uint32_t current;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    uint32_t total;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <a class="code" href="structblfwk_1_1updater__task__t.html">updater_task_t</a>(<span class="keyword">const</span> <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> &amp;task_desc, uint32_t total)</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        : task_desc(task_desc)</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        , current(0)</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        , total(total)</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    {</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    }</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <a class="code" href="structblfwk_1_1updater__task__t.html">updater_task_t</a>()</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        : task_desc()</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;        , current(0)</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;        , total(0)</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    {</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    }</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;};</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="keyword">typedef</span> std::vector&lt;updater_task_t&gt; updater_task_vector_t;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="keyword">const</span> <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> kUpdaterOperation_Update(0, <span class="stringliteral">&quot;Update&quot;</span>);</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="structblfwk_1_1updater__operation__t.html">  111</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structblfwk_1_1updater__operation__t.html">updater_operation_t</a></div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;{</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> operation_desc;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    updater_task_vector_t tasks;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    uint32_t current_task;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="keywordtype">bool</span> user_stopped;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    uint32_t current()</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    {</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        uint32_t current = 0;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; current_task; ++i)</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        {</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;            current += tasks[i].total;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        }</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        current += tasks[current_task].current;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        <span class="keywordflow">return</span> current;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    }</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    uint32_t total()</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    {</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        uint32_t total = 0;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;        <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; tasks.size(); ++i)</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;        {</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;            total += tasks[i].total;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        }</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        <span class="keywordflow">return</span> total;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    }</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <a class="code" href="structblfwk_1_1updater__operation__t.html">updater_operation_t</a>(<a class="code" href="structblfwk_1_1updater__enum__t.html">updater_enum_t</a> operation_desc)</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        : operation_desc(operation_desc)</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        , tasks()</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        , current_task(0)</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        , user_stopped(<span class="keyword">false</span>)</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    {</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    }</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <a class="code" href="structblfwk_1_1updater__operation__t.html">updater_operation_t</a>(uint32_t value, <span class="keyword">const</span> <span class="keywordtype">char</span> *description)</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        : operation_desc(value, description)</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;        , tasks()</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        , current_task(0)</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        , user_stopped(<span class="keyword">false</span>)</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    {</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    }</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;};</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;</div><div class="line"><a name="l00167"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html">  167</a></span>&#160;<span class="keyword">class </span><a class="code" href="classblfwk_1_1_updater.html">Updater</a> : <span class="keyword">public</span> <a class="code" href="classblfwk_1_1_bootloader.html">Bootloader</a></div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;{</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <a class="code" href="classblfwk_1_1_updater.html">Updater</a>(<span class="keyword">const</span> <a class="code" href="classblfwk_1_1_peripheral.html#structblfwk_1_1_peripheral_1_1_peripheral_config_data">Peripheral::PeripheralConfigData</a> &amp;config);</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classblfwk_1_1_updater.html">Updater</a>();</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    <span class="keyword">typedef</span> void (*progress_callback_t)(<a class="code" href="structblfwk_1_1updater__operation__t.html">updater_operation_t</a> *op);</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div><div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html#a9f15b1f352b0d2326a49f9395435c109">  182</a></span>&#160;    <a class="code" href="structblfwk_1_1updater__operation__t.html">updater_operation_t</a> <a class="code" href="classblfwk_1_1_updater.html#a9f15b1f352b0d2326a49f9395435c109">m_operation</a>;</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div><div class="line"><a name="l00187"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html#ac521d144b59ae9d448097c0d79c8a791">  187</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classblfwk_1_1_updater.html#ac521d144b59ae9d448097c0d79c8a791">setCallback</a>(progress_callback_t callback) { m_progressCallback = callback; }</div><div class="line"><a name="l00192"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html#a48551f48ea23daff01f931c0196474de">  192</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classblfwk_1_1_updater.html#a48551f48ea23daff01f931c0196474de">registerCallback</a>(<span class="keywordtype">void</span> (*callback)(<span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>), <span class="keywordtype">bool</span> *abort)</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    {</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;        m_progress.registerCallback(callback, abort);</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    }</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    status_t flashFirmware(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, uint32_t base_address);</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;    <span class="keywordtype">void</span> eraseAllUnsecure();</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="keywordtype">void</span> unlock(<span class="keywordtype">string</span> backdoor_key);</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <span class="keywordtype">bool</span> isCommandSupported(<span class="keyword">const</span> <a class="code" href="structblfwk_1_1cmd__t.html">cmd_t</a> &amp;command);</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    <span class="comment">//</span></div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    uint32_vector_t getProperty(<a class="code" href="structblfwk_1_1property__t.html">property_t</a> tag);</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;</div><div class="line"><a name="l00248"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html#a4d96fbd3cac558d611f69c7b878513fd">  248</a></span>&#160;    uint32_t <a class="code" href="classblfwk_1_1_updater.html#a4d96fbd3cac558d611f69c7b878513fd">getSectorSize</a>() { <span class="keywordflow">return</span> m_sector_size; };</div><div class="line"><a name="l00252"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html#ae65090535c767f3fc948ba737d37ee52">  252</a></span>&#160;    uint32_t <a class="code" href="classblfwk_1_1_updater.html#ae65090535c767f3fc948ba737d37ee52">getFlshSize</a>() { <span class="keywordflow">return</span> m_flashSize; };</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;    <span class="keywordtype">void</span> eraseFlashRegion(uint32_t start, uint32_t length);</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    <span class="keywordtype">void</span> eraseFlashAll(uint32_t memoryId);</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    <span class="keywordtype">void</span> programOnce(uint32_t index, uint32_t byteCount, <span class="keywordtype">string</span> data);</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    <span class="comment">//</span></div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    <span class="keywordtype">void</span> writeMemory(<a class="code" href="classblfwk_1_1_data_source_1_1_segment.html">DataSource::Segment</a> *segment);</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;    <span class="keywordtype">void</span> writeMemory(uint32_t address, <span class="keyword">const</span> uchar_vector_t &amp;data);</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;</div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;    status_t flashFromSourceFile();</div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    status_t flashFromSBFile(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename);</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;</div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00311"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html#a657c051ba4d2a611d0d00942b2387b60">  311</a></span>&#160;    uint32_t <a class="code" href="classblfwk_1_1_updater.html#a657c051ba4d2a611d0d00942b2387b60">m_base_address</a>;                </div><div class="line"><a name="l00312"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html#a7bb6418fc484b6f35b5da8ba1ebb367f">  312</a></span>&#160;    uint32_t <a class="code" href="classblfwk_1_1_updater.html#a7bb6418fc484b6f35b5da8ba1ebb367f">m_sector_size</a>;                 </div><div class="line"><a name="l00313"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html#ae084ba790558d6ef32869fa6ecbfd0b4">  313</a></span>&#160;    uint32_t <a class="code" href="classblfwk_1_1_updater.html#ae084ba790558d6ef32869fa6ecbfd0b4">m_flashStart</a>;                  </div><div class="line"><a name="l00314"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html#a77e2324d84433e1deb33556f43188bba">  314</a></span>&#160;    uint32_t <a class="code" href="classblfwk_1_1_updater.html#a77e2324d84433e1deb33556f43188bba">m_flashSize</a>;                   </div><div class="line"><a name="l00315"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html#af88ab43975fa62a2e44ed3a8e9708698">  315</a></span>&#160;    <a class="code" href="classblfwk_1_1_source_file.html">SourceFile</a> *<a class="code" href="classblfwk_1_1_updater.html#af88ab43975fa62a2e44ed3a8e9708698">m_sourceFile</a>;               </div><div class="line"><a name="l00316"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html#aca469b34aa17b09f68cba8192ae3eda0">  316</a></span>&#160;    progress_callback_t <a class="code" href="classblfwk_1_1_updater.html#aca469b34aa17b09f68cba8192ae3eda0">m_progressCallback</a>; </div><div class="line"><a name="l00317"></a><span class="lineno"><a class="line" href="classblfwk_1_1_updater.html#aafcbe72624e4193f2ce458ffe38ecf9b">  317</a></span>&#160;    <a class="code" href="classblfwk_1_1_progress.html">Progress</a> <a class="code" href="classblfwk_1_1_updater.html#aafcbe72624e4193f2ce458ffe38ecf9b">m_progress</a>;                    </div><div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;};</div><div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;</div><div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;}; <span class="comment">// namespace blfwk</span></div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;</div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;</div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;<span class="preprocessor">#endif // _Updater_h_</span></div><div class="ttc" id="classblfwk_1_1_updater_html_af88ab43975fa62a2e44ed3a8e9708698"><div class="ttname"><a href="classblfwk_1_1_updater.html#af88ab43975fa62a2e44ed3a8e9708698">blfwk::Updater::m_sourceFile</a></div><div class="ttdeci">SourceFile * m_sourceFile</div><div class="ttdoc">SourceFile object. </div><div class="ttdef"><b>Definition:</b> Updater.h:315</div></div>
<div class="ttc" id="classblfwk_1_1_bootloader_html"><div class="ttname"><a href="classblfwk_1_1_bootloader.html">blfwk::Bootloader</a></div><div class="ttdoc">Represents the host bootloader. </div><div class="ttdef"><b>Definition:</b> src/blfwk/Bootloader.h:52</div></div>
<div class="ttc" id="classblfwk_1_1_updater_html_aafcbe72624e4193f2ce458ffe38ecf9b"><div class="ttname"><a href="classblfwk_1_1_updater.html#aafcbe72624e4193f2ce458ffe38ecf9b">blfwk::Updater::m_progress</a></div><div class="ttdeci">Progress m_progress</div><div class="ttdoc">Progress control. </div><div class="ttdef"><b>Definition:</b> Updater.h:317</div></div>
<div class="ttc" id="namespaceblfwk_html"><div class="ttname"><a href="namespaceblfwk.html">blfwk</a></div><div class="ttdef"><b>Definition:</b> BlfwkErrors.h:16</div></div>
<div class="ttc" id="classblfwk_1_1_updater_html"><div class="ttname"><a href="classblfwk_1_1_updater.html">blfwk::Updater</a></div><div class="ttdoc">Update class contains the functionality necessary to update the firmware on a device running Bootload...</div><div class="ttdef"><b>Definition:</b> Updater.h:167</div></div>
<div class="ttc" id="classblfwk_1_1_updater_html_ae65090535c767f3fc948ba737d37ee52"><div class="ttname"><a href="classblfwk_1_1_updater.html#ae65090535c767f3fc948ba737d37ee52">blfwk::Updater::getFlshSize</a></div><div class="ttdeci">uint32_t getFlshSize()</div><div class="ttdoc">get Device&amp;#39;s flash size. </div><div class="ttdef"><b>Definition:</b> Updater.h:252</div></div>
<div class="ttc" id="classblfwk_1_1_updater_html_a7bb6418fc484b6f35b5da8ba1ebb367f"><div class="ttname"><a href="classblfwk_1_1_updater.html#a7bb6418fc484b6f35b5da8ba1ebb367f">blfwk::Updater::m_sector_size</a></div><div class="ttdeci">uint32_t m_sector_size</div><div class="ttdoc">Sector size of the flash on the device. </div><div class="ttdef"><b>Definition:</b> Updater.h:312</div></div>
<div class="ttc" id="classblfwk_1_1_updater_html_a657c051ba4d2a611d0d00942b2387b60"><div class="ttname"><a href="classblfwk_1_1_updater.html#a657c051ba4d2a611d0d00942b2387b60">blfwk::Updater::m_base_address</a></div><div class="ttdeci">uint32_t m_base_address</div><div class="ttdoc">Base address of the image. </div><div class="ttdef"><b>Definition:</b> Updater.h:311</div></div>
<div class="ttc" id="classblfwk_1_1_updater_html_a9f15b1f352b0d2326a49f9395435c109"><div class="ttname"><a href="classblfwk_1_1_updater.html#a9f15b1f352b0d2326a49f9395435c109">blfwk::Updater::m_operation</a></div><div class="ttdeci">updater_operation_t m_operation</div><div class="ttdoc">Struct used to monitor the Operation progress. </div><div class="ttdef"><b>Definition:</b> Updater.h:182</div></div>
<div class="ttc" id="classblfwk_1_1_updater_html_a77e2324d84433e1deb33556f43188bba"><div class="ttname"><a href="classblfwk_1_1_updater.html#a77e2324d84433e1deb33556f43188bba">blfwk::Updater::m_flashSize</a></div><div class="ttdeci">uint32_t m_flashSize</div><div class="ttdoc">The flash size (in bytes) of the device. </div><div class="ttdef"><b>Definition:</b> Updater.h:314</div></div>
<div class="ttc" id="structblfwk_1_1cmd__t_html"><div class="ttname"><a href="structblfwk_1_1cmd__t.html">blfwk::cmd_t</a></div><div class="ttdef"><b>Definition:</b> Command.h:53</div></div>
<div class="ttc" id="structblfwk_1_1updater__operation__t_html"><div class="ttname"><a href="structblfwk_1_1updater__operation__t.html">blfwk::updater_operation_t</a></div><div class="ttdef"><b>Definition:</b> Updater.h:111</div></div>
<div class="ttc" id="structblfwk_1_1updater__task__t_html"><div class="ttname"><a href="structblfwk_1_1updater__task__t.html">blfwk::updater_task_t</a></div><div class="ttdef"><b>Definition:</b> Updater.h:82</div></div>
<div class="ttc" id="structblfwk_1_1updater__enum__t_html"><div class="ttname"><a href="structblfwk_1_1updater__enum__t.html">blfwk::updater_enum_t</a></div><div class="ttdef"><b>Definition:</b> Updater.h:45</div></div>
<div class="ttc" id="classblfwk_1_1_source_file_html"><div class="ttname"><a href="classblfwk_1_1_source_file.html">blfwk::SourceFile</a></div><div class="ttdoc">Abstract base class for a source file containing executable code. </div><div class="ttdef"><b>Definition:</b> src/blfwk/SourceFile.h:56</div></div>
<div class="ttc" id="classblfwk_1_1_updater_html_a4d96fbd3cac558d611f69c7b878513fd"><div class="ttname"><a href="classblfwk_1_1_updater.html#a4d96fbd3cac558d611f69c7b878513fd">blfwk::Updater::getSectorSize</a></div><div class="ttdeci">uint32_t getSectorSize()</div><div class="ttdoc">get Device&amp;#39;s flash sector size. </div><div class="ttdef"><b>Definition:</b> Updater.h:248</div></div>
<div class="ttc" id="classblfwk_1_1_data_source_1_1_segment_html"><div class="ttname"><a href="classblfwk_1_1_data_source_1_1_segment.html">blfwk::DataSource::Segment</a></div><div class="ttdoc">Discrete, contiguous part of the source&amp;#39;s data. </div><div class="ttdef"><b>Definition:</b> src/blfwk/DataSource.h:65</div></div>
<div class="ttc" id="classblfwk_1_1_progress_html"><div class="ttname"><a href="classblfwk_1_1_progress.html">blfwk::Progress</a></div><div class="ttdoc">Contains the callback function for progress and abort phase. </div><div class="ttdef"><b>Definition:</b> Command.h:225</div></div>
<div class="ttc" id="classblfwk_1_1_updater_html_ac521d144b59ae9d448097c0d79c8a791"><div class="ttname"><a href="classblfwk_1_1_updater.html#ac521d144b59ae9d448097c0d79c8a791">blfwk::Updater::setCallback</a></div><div class="ttdeci">void setCallback(progress_callback_t callback)</div><div class="ttdoc">Set the user-defined function to call on progress events. </div><div class="ttdef"><b>Definition:</b> Updater.h:187</div></div>
<div class="ttc" id="structblfwk_1_1property__t_html"><div class="ttname"><a href="structblfwk_1_1property__t.html">blfwk::property_t</a></div><div class="ttdef"><b>Definition:</b> Command.h:117</div></div>
<div class="ttc" id="classblfwk_1_1_updater_html_ae084ba790558d6ef32869fa6ecbfd0b4"><div class="ttname"><a href="classblfwk_1_1_updater.html#ae084ba790558d6ef32869fa6ecbfd0b4">blfwk::Updater::m_flashStart</a></div><div class="ttdeci">uint32_t m_flashStart</div><div class="ttdoc">Start address of the flash on the device. </div><div class="ttdef"><b>Definition:</b> Updater.h:313</div></div>
<div class="ttc" id="classblfwk_1_1_updater_html_a48551f48ea23daff01f931c0196474de"><div class="ttname"><a href="classblfwk_1_1_updater.html#a48551f48ea23daff01f931c0196474de">blfwk::Updater::registerCallback</a></div><div class="ttdeci">void registerCallback(void(*callback)(int, int, int), bool *abort)</div><div class="ttdoc">Set callback for progress and abort control. </div><div class="ttdef"><b>Definition:</b> Updater.h:192</div></div>
<div class="ttc" id="classblfwk_1_1_updater_html_aca469b34aa17b09f68cba8192ae3eda0"><div class="ttname"><a href="classblfwk_1_1_updater.html#aca469b34aa17b09f68cba8192ae3eda0">blfwk::Updater::m_progressCallback</a></div><div class="ttdeci">progress_callback_t m_progressCallback</div><div class="ttdoc">Callback used to report update progress. </div><div class="ttdef"><b>Definition:</b> Updater.h:316</div></div>
<div class="ttc" id="classblfwk_1_1_peripheral_html_structblfwk_1_1_peripheral_1_1_peripheral_config_data"><div class="ttname"><a href="classblfwk_1_1_peripheral.html#structblfwk_1_1_peripheral_1_1_peripheral_config_data">blfwk::Peripheral::PeripheralConfigData</a></div><div class="ttdef"><b>Definition:</b> Peripheral.h:60</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_80fb9e53c172a775cab667063273d0e3.html">blfwk</a></li><li class="navelem"><b>Updater.h</b></li>
    <li class="footer">Generated on Mon Mar 7 2016 16:49:50 for Kinetis Bootloader Host by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
